package com.naiterui.ehp.bs.emr.vo.health;

import com.naiterui.ehp.bp.support.exception.BusinessException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;

/**
 * @Description 健康档案VO
 * @Author gongbaoqiang
 * @Date 2020/6/2 2:06 PM
 */
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("健康档案VO")
public class HealthRecordVO implements Serializable {
    private static final long serialVersionUID = -646563638322286561L;

    /**
     * 档案状态：1：草稿，2：已提交
     */
    public static final int STATUS_CACHE = 1;
    public static final int STATUS_SUBMIT = 2;

    /**
     * 基本信息
     */
    private  BaseInfoVO baseInfo;

    //======既往史===============

    /**
     * 传染病史
     */
    private InfectionVO infection;

    /**
     * 慢病史
     */
    private ChronicVO chronic;

    /**
     * 外伤史
     */
    private TraumaVO trauma;

    /**
     * 输血史
     */
    private  TransfusionVO transfusion;

    /**
     * 预防接种史
     */
    private VaccinationVO vaccination;

    //======既往史===============


    //======个人史===============
    /**
     * 吸烟史
     */
    private SmokingVO smoking;

    /**
     * 饮酒史
     */
    private DrinkingVO drinking;

    /**
     * 疫区涉足史
     */
    private EpidemicAreaVO eah;

    /**
     * 婚育史
     */
    private MchVO mch;

    /**
     * 过敏史
     */
    private AllergyVO allergy;

    /**
     * 档案状态：1：草稿，2：已提交
     */
    @ApiModelProperty("档案状态：1：草稿，2：已提交")
    private Integer status;


    //======个人史===============

    public void validate() throws BusinessException{
        baseInfo.validate();
        infection.validate();
        chronic.validate();
        trauma.validate();
        transfusion.validate();
        vaccination.validate();
        smoking.validate();
        drinking.validate();
        eah.validate();
        mch.validate();
        allergy.validate();

    }

}
